package com.example.service.impl;

import com.example.Dao.OrdersDao;
import com.example.entity.Goods;
import com.example.entity.Orders;
import com.example.service.OrdersService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OrdersServiceImpl implements OrdersService {
    @Resource
    OrdersDao ordersDao;
    @Override
    public PageInfo<Orders> queryAll(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize );
        List<Orders> list=ordersDao.queryAll();
        PageInfo<Orders> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public int deleteByID(Integer id) {
        return ordersDao.deleteByID(id);
    }

    @Override
    public Orders findById(Integer id) {
        return ordersDao.findById(id);
    }

    @Override
    public int update(Orders orders) {
        return ordersDao.update(orders);
    }

    @Override
    public int insert(Orders orders) {
        return ordersDao.insert(orders);
    }
}
